package com.woniuxy.creditsystem.common.configure;

import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Configuration 说：该类是一个配置类
 */
@Configuration
public class SpringMVCConfigure implements WebMvcConfigurer {

    /**
     * 配置页面跳转控制器
     *
     * @param registry
     */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        /*配置 跳转页面控制器 */
        registry.addViewController("/go").setViewName("index");
        registry.addViewController("/").setViewName("index");
        registry.addViewController("/dashboard").setViewName("dashboard");
        registry.addViewController("/table").setViewName("table");
        registry.addViewController("/login").setViewName("login");

        registry.addViewController("/product").setViewName("productmag/product");
        registry.addViewController("/moneyditch").setViewName("moneyditchmag/moneyditch");
        registry.addViewController("/finance").setViewName("statisticsmag/finance");
        registry.addViewController("/vehicle").setViewName("mortgagemag/vehicle");
        registry.addViewController("/house").setViewName("mortgagemag/house");
        registry.addViewController("/collection").setViewName("collectionmag/collection");

        //系统管理模块
        registry.addViewController("/collectionInfo").setViewName("collectionmag/collectionInfo");
        registry.addViewController("/data_dictionary").setViewName("systemmag/data_dictionary");
        registry.addViewController("/process_model").setViewName("systemmag/process_model");
        registry.addViewController("/company").setViewName("systemmag/company");
        registry.addViewController("/company_detail").setViewName("systemmag/company_detail");
        registry.addViewController("/process_detail").setViewName("systemmag/process_detail");

        //汪的页面
        registry.addViewController("/waitloan").setViewName("loanmag/waitforloan");
        registry.addViewController("/haslend").setViewName("loanmag/haslend");
        registry.addViewController("/allorder").setViewName("loanmag/allorder");
        registry.addViewController("/duea").setViewName("loanmag/duea");
        registry.addViewController("/dueb").setViewName("loanmag/dueb");
        registry.addViewController("/duec").setViewName("loanmag/duec");
        registry.addViewController("/dued").setViewName("loanmag/dued");
        registry.addViewController("/duee").setViewName("loanmag/dueall");

        registry.addViewController("/page_test").setViewName("systemmag/page_test");


        //统计模块
        registry.addViewController("/ceshi").setViewName("statisticsmag/ceshi");
        registry.addViewController("/userconversion").setViewName("statisticsmag/userconversion");
        registry.addViewController("/usercondet").setViewName("statisticsmag/usercondet");
        registry.addViewController("/overdue").setViewName("statisticsmag/overdue");
        registry.addViewController("/opdata").setViewName("statisticsmag/opdata");

        //夏 产品合作的页面
        registry.addViewController("/product").setViewName("productmag/product");
        //夏 资金渠道的页面
        registry.addViewController("/moneyditch").setViewName("moneyditchmag/moneyditch");

        registry.addViewController("/customer").setViewName("customermag/customer");
        registry.addViewController("/apply").setViewName("applymag/apply");
        registry.addViewController("/first_trial").setViewName("applymag/firstTrial");
        registry.addViewController("/reexamine").setViewName("applymag/Reexamine");


        /*可以继续配置*/
        //systemmag下面的html文件
        registry.addViewController("/account_mag").setViewName("systemmag/account_mag");
        registry.addViewController("/role_mag").setViewName("systemmag/role_mag");
        registry.addViewController("/unauthorized").setViewName("systemmag/unauthorized");
        registry.addViewController("/loginOk").setViewName("systemmag/loginOk");
        registry.addViewController("/system_log").setViewName("systemmag/system_log");
        registry.addViewController("/download_center").setViewName("systemmag/download_center");

        //financialmag的html文件
        registry.addViewController("/putmoney").setViewName("financialmag/putmoney");
        registry.addViewController("/returnmoney").setViewName("financialmag/returnmoney");
        registry.addViewController("/platservice").setViewName("financialmag/platservice");
        registry.addViewController("/moneyset").setViewName("financialmag/moneyset");


        //将该注册器，权限设置为SpringMVC框架中最高权限
        registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
    }


}
